home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_geomview.idb / usr / freeware / info / geomview-4.z / geomview-4
Encoding:
Text File  |  1999-01-26  |  57.2 KB  |  1,366 lines

  1. Info file: geomview,    -*-Text-*-
  2. produced by texinfo-format-buffer
  3. from file: geomview.tex
  4.  
  5.  
  6. 
  7. File: geomview  Node: Example4, Prev: Example3, Up: Modules, Next: Module Installation
  8.  
  9. Example 4: Simple Tcl/Tk Module Demonstrating Picking
  10. =====================================================
  11.  
  12. It's not necessary to write a Geomview module in C.  The only requirement
  13. of an external module is that it send GCL commands to its standard output
  14. and expect responses (if any) on its standard input.   An external module
  15. can be written in C, perl, tcl/tk, or pretty much anything.
  16.  
  17. As an example, assuming you have Tcl/Tk version 4.0 or later,
  18. here's an external module with a simple GUI which demonstrates interaction with
  19. geomview.  This manual doesn't discuss the Tcl/Tk language; see the good book
  20. on the subject by its originator John Ousterhout, published by Addison-Wesley,
  21. titled *Tcl and the Tk Toolkit*.
  22.  
  23. The `#!' on the script's first line causes the system to interpret
  24. the script using the Tcl/Tk `wish' program; you might have to change its
  25. first line if that's in some location other than /usr/local/bin/wish4.0.
  26. Or, you could define it as a module using
  27.        (emodule-define  "Pick Demo"  "wish pickdemo.tcl")
  28. in which case `wish' could be anywhere on the UNIX search path.
  29.  
  30.      #! /usr/local/bin/wish4.0
  31.  
  32.      # We use "fileevent" below to have "readsomething" be called whenever
  33.      # data is available from standard input, i.e. when geomview has sent us
  34.      # something.  It promises to include a trailing newline, so we can use
  35.      # "gets" to read the geomview response, then parse its nested parentheses
  36.      # into tcl-friendly {} braces.
  37.  
  38.      proc readsomething {} {
  39.        if {[gets stdin line] < 0} {
  40.              puts stderr "EOF on input, exiting..."
  41.              exit
  42.        }
  43.        regsub -all {\(} $line "\{" line
  44.        regsub -all {\)} $line "\}" line
  45.        # Strip outermost set of braces
  46.        set stuff [lindex $line 0]
  47.        # Invoke handler for whichever command we got.  Could add others here,
  48.        # if we asked geomview for other kinds of data as well.
  49.        switch [lindex $stuff 0] {
  50.              pick     {handlepick $stuff}
  51.              rawevent {handlekey $stuff}
  52.        }
  53.      }
  54.  
  55.      # Fields of a "pick" response, from geomview manual:
  56.      #     (pick COORDSYS GEOMID G V E F P VI EI FI)
  57.      #          The pick command is executed internally in response to pick
  58.      #          events (right mouse double click).
  59.      #
  60.      #          COORDSYS = coordinate system in which coordinates of the following
  61.      #              arguments are specified.   This can be:
  62.      #               world: world coord sys
  63.      #               self:  coord sys of the picked geom (GEOMID)
  64.      #               primitive: coord sys of the actual primitive within
  65.      #                   the picked geom where the pick occurred.
  66.      #          GEOMID = id of picked geom
  67.      #          G = picked point (actual intersection of pick ray with object)
  68.      #          V = picked vertex, if any
  69.      #          E = picked edge, if any
  70.      #          F = picked face
  71.      #          P = path to picked primitive [0 or more]
  72.      #          VI = index of picked vertex in primitive
  73.      #          EI = list of indices of endpoints of picked edge, if any
  74.      #          FI = index of picked face
  75.  
  76.      # Report when user picked something.
  77.      # 
  78.      proc handlepick {pick} {
  79.        global nameof selvert seledge order
  80.        set obj [lindex $pick 2]
  81.        set xyzw [lindex $pick 3]
  82.        set fv [lindex $pick 6]
  83.        set vi [lindex $pick 8] 
  84.        set ei [lindex $pick 9] 
  85.        set fi [lindex $pick 10]
  86.  
  87.        # Report result, converting 4-component homogeneous point into 3-space point.
  88.        set w [lindex $xyzw 3]
  89.        set x [expr [lindex $xyzw 0]/$w]
  90.        set y [expr [lindex $xyzw 0]/$w]
  91.        set z [expr [lindex $xyzw 0]/$w]
  92.        set s "$x $y $z "
  93.        if {$vi >= 0} {
  94.              set s "$s  vertex #$vi"
  95.        }
  96.        if {$ei != {}} {
  97.              set s "$s  edge [lindex $ei 0]-[lindex $ei 1]"
  98.        }
  99.        if {$fi != -1} {
  100.              set s "$s  face #$fi ([expr [llength $fv]/3]-gon)"
  101.        }
  102.        msg $s
  103.      }
  104.  
  105.  
  106.      # Having asked for notification of these raw events, we report when
  107.      # the user pressed these keys in the geomview graphics windows.
  108.  
  109.      proc handlekey {event} {
  110.        global lastincr
  111.        switch [lindex $event 1] {
  112.          32 {msg "Pressed space bar"}
  113.           8 {msg "Pressed backspace key"}
  114.        }
  115.      }
  116.  
  117.  
  118.      #
  119.      # Display a message on the control panel, and on the terminal where geomview
  120.      # was started.  We use "puts stderr ..." rather than simply "puts ...",
  121.      # since Geomview interprets anything we send to standard output
  122.      # as a GCL command!
  123.      #
  124.      proc msg {str} {
  125.        global msgtext
  126.        puts stderr $str
  127.        set msgtext $str
  128.        update
  129.      }
  130.  
  131.      # Load object from file
  132.      proc loadobject {fname} {
  133.        if {$fname != ""} {
  134.              puts "(geometry thing < $fname)"
  135.              # Be sure to flush output to ensure geomview receives this now!
  136.              flush stdout
  137.        }
  138.      }
  139.  
  140.  
  141.      # Build simple "user interface"
  142.  
  143.      # The message area could be a simple label rather than an entry box,
  144.      # but we want to be able to use X selection to copy text from it.
  145.      # The default mouse bindings do that automatically.
  146.  
  147.      entry .msg -textvariable msgtext -width 45
  148.      pack .msg
  149.  
  150.      frame .f
  151.  
  152.        label .f.l -text "File to load:"
  153.        pack .f.l -side left
  154.  
  155.        entry .f.ent -textvariable fname
  156.        pack .f.ent -side left -expand true -fill x
  157.        bind .f.ent <Return> { loadobject $fname }
  158.  
  159.      pack .f
  160.  
  161.  
  162.      # End UI definition.
  163.  
  164.  
  165.      # Call "readsomething" when data arrives from geomview.
  166.  
  167.      fileevent stdin readable {readsomething}
  168.  
  169.      # Geomview initialization
  170.  
  171.      puts {
  172.              (interest (pick primitive))
  173.              (interest (rawevent 32))    # Be notified when user presses space
  174.              (interest (rawevent 8))        # or backspace keys.
  175.              (geometry thing < hdodec.off)
  176.              (normalization world none)
  177.      }
  178.      # Flush to ensure geomview receives this.
  179.      flush stdout
  180.  
  181.      wm title . {Sample external module}
  182.  
  183.      msg "Click right mouse in graphics window"
  184.  
  185. 
  186. File: geomview  Node: Module Installation, Prev: Example4, Up: Modules, Next: Private Module Installation
  187.  
  188. Module Installation
  189. ===================
  190.  
  191. This section tells how to install an external module so you can invoke
  192. it within Geomview.  There are two ways to install a module: you can
  193. install a *private* module so that the module is available to you
  194. whenever you run Geomview, or you can install a *system* module
  195. so that the module is available to all users on your system whenever they
  196. run Geomview.
  197.  
  198. * Menu:
  199.  
  200. * Private Module Installation::.
  201. * System Module Installation::.
  202.  
  203.  
  204. 
  205. File: geomview  Node: Private Module Installation, Prev: Module Installation, Up: Module Installation, Next: System Module Installation
  206.  
  207. Private Module Installation
  208. ---------------------------
  209.  
  210. The `emodule-define' command arranges for a module to appear in
  211. Geomview's *Modules* browser.  `emodule-define' takes two
  212. string arguments; the first is the name that will appear in the
  213. *Modules* browser.  The second is the shell command for running
  214. the module; it may include arguments.  Geomview executes this command in
  215. a subshell when you click on the module's entry in the browser.  For
  216. example
  217.  
  218.      (emodule-define "Foo" "/u/home/modules/foo -x")
  219.  
  220. adds a line labeled "Foo" to the *Modules* browser which
  221. causes the command "/u/home/modules/foo -x" to be executed when selected.
  222.  
  223. You may put `emodule-define' commands in your `~/.geomview'
  224. file to arrange for certain modules to be available every time you run
  225. Geomview; *Note Customization::.  You can also execute
  226. `emodule-define' commands from the *Commands* panel
  227. to add a module to an already running copy of Geomview.
  228.  
  229. There are several other gcl commands for controlling the entries
  230. in the *Modules* browser; for details, *Note GCL::.
  231.  
  232. 
  233. File: geomview  Node: System Module Installation, Prev: Private Module Installation, Up: Module Installation, Next: GCL
  234.  
  235. System Module Installation
  236. --------------------------
  237.  
  238. To install a module so that it is available to all Geomview users do
  239. the following
  240.  
  241.  
  242. 1.
  243.      Create a file called `.geomview-MODULE' where
  244.      `MODULE' is the name of the module.  This file should contain
  245.      a single line which is an `emodule-define' command for that module:
  246.           (emodule-define "New Module" "newmodule")
  247.      The first argument, `"New Module"' above, is the string that will
  248.      appear in the *Modules* browser.  The second string,
  249.      `"newmodule"' above, is the Bourne shell command for invoking the module.
  250.      It may include arguments, and you may assume that the module is on the
  251.      $path searched by the shell.
  252.  
  253. 2.
  254.      Put a copy of the `.geomview-MODULE' and the module
  255.      executable itself in Geomview's `modules/sgi' directory.  This is a
  256.      subdirectory of the Geomview distribution directory (on the Geometry
  257.      Center's system the pathname is `/u/gcg/ngrap/modules/sgi'.
  258.  
  259.  
  260. After these steps, the new module should appear, in alphabetical
  261. position, in the *Modules* browser of Geomview's *Main*
  262. panel next time Geomview is run.  The reason this works is that when
  263. Geomview is invoked it processes all the `.geomview-*' files in its
  264. `modules' directory.  It also remembers the pathname of this
  265. directory and prepends that path to the $path of the shell in which it
  266. invokes such a module.
  267.  
  268. 
  269. File: geomview  Node: GCL, Prev: System Module Installation, Up: Top, Next: Argument Conventions
  270.  
  271. gcl: the Geomview Command Language
  272. **********************************
  273.  
  274. Gcl has the syntax of lisp -- i.e. an expression of the form (f a b
  275. ...) means pass the values of a, b, ... to the function f.
  276. Gcl is very limited and is by no means an implementation of lisp.  It
  277. is simply a language for expressing commands to be executed in the order
  278. given, rather than a programming language.  It does not support variable
  279. or function definition.
  280.  
  281. Gcl is the language that Geomview understands for files that it loads
  282. as well as for communication with other programs. 
  283. To execute a gcl command interactively, you can bring up the
  284. *Commands* panel which lets you type in a command; Geomview
  285. executes the command when you hit the return key.  Output from such
  286. commands is printed to standard output.  Alternately, you can invoke
  287. Geomview as `geomview -c -' which causes it to read gcl commands
  288. from standard input.
  289.  
  290. Gcl functions return a value, and you can nest function calls in ways
  291. which use this returned value.  For example
  292.      (f (g a b))
  293. evaluates `(g a b)' and then evaluates `(f x)' where `x'
  294. is the result returned by `(g a b)'.  Geomview maintains these
  295. return values internally but does not normally print them out.
  296. To print out a return value pass it to the `echo' function.
  297. For example the `geomview-version' function returns a string
  298. representing the version of Geomview that is running, and
  299.      (echo (geomview-version))
  300. prints out this string.
  301.  
  302. Many functions simply return `t' for success or `nil' for
  303. failure; this is the case if the documentation for the function does not
  304. indicate otherwise.  These are the lisp symbols for true and false,
  305. respectively.  (They correspond to the C variables `Lt' and
  306. `Lnil' which you are likely to see if you look at the source code
  307. for Geomview or some of the external modules.)
  308.  
  309. In the descriptions of the commands below several references are made to
  310. "OOGL" formats.  OOGL is the data description language that Geomview
  311. uses for describing geometry, cameras, appearances, and other basic
  312. objects.  For details of the OOGL formats, *Note OOGL File Formats::.
  313. (Or equivalently, see the oogl(5) manual page, distributed with Geomview
  314. in the file man/cat5/oogl.5.
  315.  
  316. The gcl commands and argument types are listed below.  Most
  317. of the documentation in this section of the manual is available within
  318. Geomview via the `?' and `??' commands.  The command `(?
  319. COMMAND)' causes Geomview to print out a one-line summary of the
  320. syntax of COMMAND, and `(?? COMMAND)' prints out an
  321. explanation of what COMMAND does.  You can include the wild-card
  322. character `*' in COMMAND to print information for a group of
  323. commands matching a pattern.  For example, `(?? *emodule*)' will
  324. print all information about all commands containing the string
  325. `emodule'.  `(? *)' will print a short list of all commands.
  326.  
  327. * Menu:
  328.  
  329. * Argument Conventions::  Conventions used in describing argument types.
  330. * Gcl Reference::      Documentation for each gcl command.
  331.  
  332. 
  333. File: geomview  Node: Argument Conventions, Prev: GCL, Up: GCL, Next: Gcl Reference
  334.  
  335. Conventions Used In Describing Argument Types
  336. =============================================
  337.  
  338. The following symbols are used to describe argument types
  339. in the documentation for gcl functions.
  340.  
  341.  
  342. `APPEARANCE'
  343.      is an OOGL appearance specification.
  344.  
  345. `CAM-ID'
  346.      is an ID that refers to a camera.
  347.  
  348. `CAMERA'
  349.      is an OOGL camera specification.
  350.  
  351. `GEOM-ID'
  352.      is an ID that refers to a geometry.
  353.  
  354. `GEOMETRY'
  355.      is an OOGL geometry specification.
  356.  
  357. `ID'
  358.      is a string which names a geometry or camera.  Besides
  359.      those you create, valid ones are:
  360.  
  361.  
  362.      ``World, world, worldgeom, g0''
  363.           the collection of all geom's
  364.  
  365.      `target'
  366.           selected target object (cam or geom)
  367.  
  368.      `center'
  369.           selected center-of-motion object
  370.  
  371.      `targetcam'
  372.           last selected target camera
  373.  
  374.      `targetgeom'
  375.           last selected target geom
  376.  
  377.      `focus'
  378.           camera where cursor is (or most recently was)
  379.  
  380.      `allgeoms'
  381.           all geom objects
  382.  
  383.      `allcams'
  384.           all cameras
  385.  
  386.      ``default, defaultcam, prototype''
  387.           future cameras inherit default's settings
  388.  
  389.  
  390.      The following IDs are used to name coordinate systems,
  391.      e.g. in `pick' and `write' commands:
  392.  
  393.  
  394.      ``World, world, worldgeom, g0''
  395.           the world, within which all other geoms live.
  396.  
  397.      `universe '
  398.           the universe, in which the World, lights and cameras live.  Cameras'
  399.           world2cam transforms might better be called universe2cam, etc.
  400.  
  401.      `self'
  402.           "this Geomview object".  Transform from an object to `self' is the
  403.           identity; writing its geometry gives the object itself with no
  404.           enclosing transform; picked points appear in the object's coordinates.
  405.  
  406.      `primitive'
  407.           (for `pick' only) Picked points appear in the coordinate system of the
  408.           lowest-level OOGL primitive.
  409.  
  410.  
  411.      A name is also an acceptable id.  Given names are made unique by
  412.      appending numbers if necessary (i.e. `foo<2>'). Every geom is also
  413.      named g[n] and every camera is also named c[n] (`g0' is always the
  414.      worldgeom): this name is used as a prefix to keyboard commands and can
  415.      also be used as a gcl id.  Numbers are reused after an
  416.      object is deleted. Both names are shown in the Object browser.
  417.  
  418. `STATEMENT'
  419.      represents a function call.  Function calls have the form `(func arg1
  420.      arg2 ... )', where `func' is the name of the function and `arg1',
  421.      `arg2', ... are the arguments.
  422.  
  423. `TRANSFORM'
  424.      is an OOGL 4x4 transformation matrix.
  425.  
  426. `WINDOW'
  427.      is an OOGL winddow specification.
  428.  
  429.  
  430. 
  431. File: geomview  Node: Gcl Reference, Prev: Argument Conventions, Up: GCL, Next: Non-Euclidean Geometry
  432.  
  433. Gcl Reference Guide
  434. ===================
  435.  
  436.  
  437. `! is a synonym for `shell''
  438.  
  439. `(< EXPR1 EXPR2)'
  440.      Returns t if EXPR1 is less than EXPR2.  EXPR1 and EXPR2 should
  441.      be either both integers or floats, or both strings.
  442.  
  443. `(= EXPR1 EXPR2)'
  444.      Returns t if EXPR1 is equal to EXPR2.  EXPR1 and EXPR2 should
  445.      be either both integers or floats, or both strings.
  446.  
  447. `(> EXPR1 EXPR2)'
  448.      Returns t if EXPR1 is greater than EXPR2.  EXPR1 and EXPR2 should
  449.      be either both integers or floats, or both strings.
  450.  
  451. `(?  [command])'
  452.      Gives one-line usage summary for `command'.
  453.      Command may include `*'s as wildcards; see also `??'
  454.      One-line command help; lists names only if multiple commands match.
  455.      ? is a synonym for `help'
  456.  
  457. `(?? command)  `command' may include `*' wildcards'
  458.      Prints more info than `(? command)'.  ?? is a synonym
  459.      for `morehelp'.
  460.  
  461. `| is a synonym for `emodule-run'.'
  462.  
  463. `(all geometry)  returns a list of names of all geometry objects.'
  464.      Use e.g. `(echo (all geometry))' to print such a list.
  465. `(all camera)    returns a list of names of all cameras.'
  466. `(all emodule defined)  returns a list of all defined external modules.'
  467. `(all emodule running)  returns a list of all running external modules.'
  468.  
  469. `(ap-override [on|off])'
  470.      Selects whether appearance controls should override objects' own
  471.      settings.  On by default.  With no arguments, returns current setting.
  472.  
  473. `(backcolor      CAM-ID R G B)'
  474.      Set the background color of CAM-ID; R G B are numbers
  475.      between 0 and 1.
  476.  
  477. `(background-image CAM-ID [FILENAME])'
  478.      Use the given image as the background of camera CAM-ID (which must be a
  479.      real camera, not `default' or `allcams'). Centers the image on
  480.      the window area.  Works only with GL and OpenGL graphics.
  481.      Use "" for filename to remove background.  With no filename argument,
  482.      returns name of that window's current background image, or "".  
  483.      Any file type acceptable as a texture is allowed, e.g. .ppm.gz, .sgi, etc.
  484.  
  485. `(bbox-color     GEOM-ID R G B)'
  486.      Set the bounding-box color of GEOM-ID; R G B are numbers
  487.      between 0 and 1.
  488.  
  489. `(bbox-draw      GEOM-ID [yes|no])'
  490.      Say whether GEOM-ID's bounding-box should be drawn; `yes' if omitted.
  491.  
  492. `(camera         CAM-ID [CAMERA])'
  493.      Specify data for CAM-ID; CAMERA is a string giving an OOGL
  494.      camera specification.  If no camera CAM-ID exists,
  495.      it is created; in this case, the second argument is optional,
  496.      and if omitted, a default camera is used.  See also: new-camera.
  497.  
  498. `(camera-draw    CAM-ID [yes|no])'
  499.      Say whether or not cameras should be drawn in CAM-ID; `yes' if omitted.
  500.  
  501. `(camera-prop { geometry object }   [projective])'
  502.      Specify the object to be shown when drawing other cameras.
  503.      By default, this object is drawn with its origin at the camera,
  504.      and with the camera looking toward the object's -Z axis.
  505.      With the `projective' keyword, the camera's viewing projection is
  506.      also applied to the object; this places the object's Z=-1 and Z=+1 at
  507.      near and far clipping planes, with the viewing area -1<={X,Y}<=+1.
  508.      Example:  (camera-prop { < cube } projective)
  509.  
  510. `(camera-reset   CAM-ID)'
  511.      Reset CAM-ID to its default value.
  512.  
  513. `(car LIST)'
  514.      returns the first element of LIST.
  515.  
  516. `(cdr LIST)'
  517.      returns the list obtained by removing the first element of LIST.
  518.  
  519. `(clock)'
  520.      Returns the current time, in seconds, as shown by this stream's clock.
  521.      See also set-clock and sleep-until.
  522.  
  523. `(command        INFILE [OUTFILE])'
  524.      Read commands from INFILE; send corresponding responses
  525.      (e.g. anything written to filename `-') to OUTFILE, stdout
  526.      by default.
  527.  
  528. `(copy [ID] [name])'
  529.      Copies an object or camera.  If ID is not specified, it 
  530.      is assumed to be targetgeom.  If name is not specified, it 
  531.      is assumed to be the same as the name of ID.
  532.  
  533. `(cursor-still [INT])'
  534.      Sets the number of microseconds for which the cursor must not
  535.      move to register as holding still.  If INT is not specified,
  536.      the value will be reset to the default.
  537.  
  538. `(cursor-twitch    [INT])'
  539.      Sets the distance which the cursor must not move (in x or
  540.      y) to register as holding still.  If INT is not specified,
  541.      the value will be reset to the default.
  542.  
  543. `(delete         ID)'
  544.      Delete object or camera ID.
  545.  
  546. `(dice           GEOM-ID N)'
  547.      Dice any Bezier patches within GEOM-ID into NxN meshes; default 10.
  548.      See also the appearance attribute `dice', which makes this command
  549.      obsolete.
  550.  
  551. `(dimension [N])'
  552.      Sets or reads the space dimension for N-dimensional viewing.
  553.      (Since calculations are done using homogeneous coordinates,
  554.      this means matrices are (N+1)x(N+1).)
  555.      With no arguments, returns the current dimension, or 0 if
  556.      N-dimensional viewing has not been enabled.
  557.  
  558. `(dither  CAM-ID {on|off|toggle})'
  559.               Turn dithering on or off in that camera.
  560.  
  561. `(draw           CAM-ID)'
  562.      Draw the view in CAM-ID, if it needs redrawing.  See also `redraw'.
  563.  
  564. `(echo          ...)'
  565.      Write the given data to the special file `-'.  Strings are written
  566.      literally; lisp expressions are evaluated and their values written.
  567.      If received from an external program, `echo' sends to the program's
  568.      input.  Otherwise writes to geomview's own standard output
  569.      (typically the terminal).
  570.  
  571. `(emodule-clear)'
  572.      Clears the geomview application (external module) browser.
  573.  
  574. `(emodule-define  NAME  SHELL-COMMAND ...)'
  575.              Define an external module called NAME, which then appears in the
  576.              external-module browser.  The SHELL-COMMAND string
  577.              is a UNIX shell command which invokes the module.
  578.              See emodule-run for discussion of external modules.
  579.  
  580. `(emodule-defined `modulename')'
  581.      If the given external-module name is known, returns the name of
  582.      the program invoked when it's run as a quoted string; otherwise
  583.      returns nil.  `(echo (emodule-defined `name'))' prints the string.
  584.  
  585. `(emodule-isrunning NAME)'
  586.      Returns Lt if the emodule NAME is running, or Lnil
  587.      if it is not running.  NAME is searched for in the
  588.      names as they appear in the browser and in the shell commands
  589.      used to execute the external modules (not including arguments).
  590.  
  591. `(emodule-path)'
  592.      Returns the current search path for external modules.
  593.      Note: to actually see the value returned by this function
  594.      you should wrap it in a call to echo: (echo (emodule-path)).
  595.              See also set-emodule-path.
  596.  
  597. `(emodule-run  SHELL-COMMAND ARGS...)'
  598.      Runs the given SHELL-COMMAND (a string containing a UNIX shell
  599.      command) as an external module.  The module's standard output
  600.      is taken as geomview commands; responses (written to filename
  601.      `-') are sent to the module's standard input.  The shell
  602.      command is interpreted by /bin/sh, so e.g. I/O redirection may
  603.      be used; a program which prompts the user for input from the
  604.      terminal could be run with:
  605.        (emodule-run  yourprogram  <&2)
  606.      If not already set, the environment variable $MACHTYPE is set
  607.      to the name of the machine type.  Input and output
  608.      connections to geomview are dropped when the shell command
  609.      terminates.  Clicking on a running program's module-browser entry
  610.      sends the signal SIGHUP to the program.  For this to work, programs
  611.      should avoid running in the background; those using FORMS or GL
  612.      should call foreground() before the first FORMS or winopen() call.
  613.      See also emodule-define, emodule-start.
  614.  
  615. `(emodule-sort)'
  616.              Sorts the modules in the application browser alphabetically.
  617.  
  618. `(emodule-start  NAME)'
  619.              Starts the external module NAME, defined by emodule-define.
  620.              Equivalent to clicking on the corresponding module-browser entry.
  621.  
  622. `(emodule-transmit NAME LIST)'
  623.      Places LIST into external module NAME's standard input.  NAME is
  624.      searched for in the names of the modules as they appear in the
  625.      External Modules browser and then in the shell commands used to
  626.      execute the external modules.  Does nothing if modname is not
  627.      running.
  628.  
  629. `(escale          GEOM-ID FACTOR)'
  630.      Same as scale but multiplies by exp(scale).  Obsolete.
  631.  
  632. `(event-keys {on|off})'
  633.               Turn keyboard events on or off to enable/disable keyboard shortcuts.
  634.  
  635. `(event-mode     MODESTRING)'
  636.      Set the mouse event (motion) mode; MODESTRING should be one of
  637.      the strings that appears in the motion mode browser (including
  638.      the keyboard shortcut, e.g. `[r] Rotate').
  639.  
  640. `(event-pick {on|off})'
  641.      Turn picking on or off.
  642.  
  643. `(evert          GEOM-ID [yes|no])'
  644.      Set the normal eversion state of GEOM-ID.  If the second argument
  645.      is omitted, toggle the eversion state.
  646.  
  647. `(exit)'
  648.      Terminates geomview.
  649.  
  650. `(ezoom          GEOM-ID FACTOR)'
  651.      Same as zoom but multiplies by exp(zoom).  Obsolete.
  652.  
  653. `(freeze         CAM-ID)'
  654.      Freeze CAM-ID; drawing in this camera's window is turned off
  655.      until it is explicitly redrawn with `(redraw CAM-ID)', after
  656.      which time drawing resumes as normal.
  657.  
  658. `(geometry       GEOM-ID [GEOMETRY])'
  659.      Specify the geometry for GEOM-ID.  GEOMETRY is a string
  660.      giving an OOGL geometry specification.  If no object
  661.      called GEOM-ID exists, it is created; in this case the
  662.      GEOMETRY argument is optional, and if omitted, the new
  663.      object GEOM-ID is given an empty geometry.
  664.  
  665. `(geomview-version)'
  666.      Returns a string representing the version of geomview that is
  667.      running.
  668.  
  669. `(hdefine  `geometry'|`camera'|`transform'|`window'  name  value)'
  670.      Sets the value of a handle of a given type.
  671.             (hdefine  <type>  <name>  <value>)
  672.      is generally equivalent to
  673.             (read <type>  { define <name> <value> })
  674.      except that the assignment is done when hdefine is executed,
  675.      (possibly not at all if inside a conditional statement),
  676.      while the `read ... define' performs assignment as soon as the
  677.      text is read.
  678.  
  679.  
  680. `(help        [command])'
  681.      Command may include `*'s as wildcards; see also `??'
  682.      One-line command help; lists names only if multiple commands match.
  683.  
  684. `(hmodel CAMID {virtual|projective|conformal})'
  685.      Set the model used to display geometry in
  686.      this camera; see also `space'.
  687.  
  688. `(hsphere-draw   CAMID [yes|no])'
  689.      Say whether to draw a unit sphere: the sphere at infinity in
  690.      hyperbolic space, and a reference sphere in Euclidean and spherical
  691.      spaces.  If the second argument is omitted, `yes' is assumed.
  692.  
  693. `(if TEST EXPR1 [EXPR2])'
  694.      Evaluates TEST; if TEST returns a non-nil value, returns the
  695.      value of EXPR1.  If TEST returns nil, returns the value of
  696.      EXPR2 if EXPR2 is present, otherwise returns nil.
  697.  
  698. `(inhibit-warning STRING)'
  699.      Inhibit warning inhbits geomview from displaying a
  700.      particular warning message determined by STRING.
  701.      At present there are no warning messages that this
  702.      applies to, so this command is rather useless.
  703.  
  704. `(input-translator  "#prefix_string"  "Bourne-shell-command")'
  705.      Defines an external translation program for special input types.
  706.      When asked to read a file which begins with the specified string,
  707.      geomview invokes that program with standard input coming from the given file.
  708.      The program is expected to emit OOGL geometric data to its standard output.
  709.      In this implementation, only prefixes beginning with # are recognized.
  710.      Useful as in
  711.             (input-translator "#VRML" "vrml2oogl")
  712.  
  713. `(interest (COMMAND [args]))'
  714.  
  715.      Allows you to express interest in a command.  When geomview
  716.      executes that command in the future it will echo it to the
  717.      communication pool from which the interest command came.
  718.      COMMAND can be any command.  Args specify restrictions on the
  719.      values of the arguments; if args are present in the interest
  720.      command, geomview will only echo calls to the command in which
  721.      the arguments match those given in the interest command.  Two
  722.      special argument values may appear in the argument list.  `*'
  723.      matches any value. `nil' matches any value but supresses the
  724.      reporting of that value; its value is reported as `nil'.
  725.  
  726.      The purpose of the interest command is to allow external
  727.      modules to find out about things happening inside geomview.
  728.      For example, a module interested in knowing when a geom called
  729.      `foo' is deleted could say `(interest (delete foo))' and would
  730.      receive the string `(delete foo)' when foo is deleted.
  731.  
  732.      Picking is a special case of this.  For most modules
  733.      interested in pick events the command `(interest (pick
  734.      world))' is sufficient.  This causes geomview to send a string
  735.      of the form `(pick world ...)' every time a pick event (right
  736.      mouse double click).  See the `pick' command for details.
  737.  
  738. `(lines-closer   CAM-ID DIST)'
  739.      Draw lines (including edges) closer to the camera than polygons
  740.      by DIST / 10^5  of the Z-buffer range.  DIST = 3.0 by default.
  741.      If DIST is too small, a line lying on a surface may be
  742.      dotted or invisible, depending on the viewpoint.
  743.      If DIST is too large, lines may appear in front of surfaces
  744.      that they actually lie behind.  Good values for DIST vary with
  745.      the scene, viewpoint, and distance between near and far clipping
  746.      planes.  This feature is a kludge, but can be helpful.
  747.  
  748. `(load  filename  [command|geometry|camera])'
  749.      Loads the given file into geomview.  The optional second argument
  750.      specifies the type of data it contains, which may be `command'
  751.      (geomview commands), `geometry' (OOGL geometric data), or
  752.      `camera' (OOGL camera definition).  If omitted, attempts to guess
  753.      about the file's contents.
  754.      Loading geometric data creates a new visible object; loading a camera
  755.      opens a new window; loading a command file executes those commands.
  756.  
  757.  
  758. `(load-path)'
  759.      Returns the current search path for command, geometry, etc. files.
  760.      Note: to actually see the value returned by this function
  761.      you should wrap it in a call to echo: (echo (load-path)).
  762.      See also set-load-path.
  763.  
  764. `(look [objectID] [cameraID])'
  765.      Rotates the named camera to point toward the center of the 
  766.      bounding box of the named object (or the origin in hyperbolic or 
  767.      spherical space).  In Euclidean space, moves the camera 
  768.      forward or backward until the object appears as large 
  769.      as possible while still being entirely visible.  Equivalent to 
  770.      progn ( 
  771.          (look-toward [objectID] [cameraID] {center | origin})
  772.          [(look-encompass [objectID] [cameraID])] 
  773.      ) 
  774.      If objectID is not specified, it is assumed to be World.  If 
  775.      cameraID is not specified, it is assumed to be targetcam.
  776.  
  777. `(look-encompass [objectID] [cameraID])'
  778.      Moves cameraID backwards or forwards until its field of view
  779.      surrounds objectID. This routine works only in Euclidean space.  
  780.      If objectID is not specified, it is assumed to be the world.  
  781.      If cameraID is not specified, it is assumed to be the targetcam.  
  782.      See also (look-encompass-size).
  783.  
  784. `(look-encompass-size [view-fraction  clip-ratio  near-margin far-margin])'
  785.      Sets/returns parameters used by (look-encompass).
  786.      view-fraction is the portion of the camera window filled by the object,
  787.      clip-ratio is the max allowed ratio of near-to-far clipping planes.
  788.      The near clipping plane is 1/near-margin times closer than the near
  789.      edge of the object, and the far clipping plane is far-margin times
  790.      further away.  Returns the list of current values.
  791.      Defaults: .75  100  0.1  4.0
  792.  
  793.  
  794. `(look-recenter [objectID] [cameraID])'
  795.      Translates and rotates the camera so that it is looking in the 
  796.      -z direction (in objectID's coordinate system) at the center of 
  797.      objectID's bounding box (or the origin of the coordinate system 
  798.      in non-Eudlidean space).  In Euclidean space, the camera is also 
  799.      moved as close as possible to the object while allowing the 
  800.      entire object to be visible.  Also makes sure that the y-axes of 
  801.      objectID and cameraID are parallel.
  802.  
  803. `(look-toward [objectID] [cameraID] [origin | center])'
  804.      Rotates the named camera to point toward the origin of the
  805.      object's coordinate system, or the center of the object's
  806.      bounding box (in non-Euclidean space, the origin will be used 
  807.      automatically).  Default objectID is the world, default camera
  808.      is targetcam, default location to point towards is the center
  809.      of the bounding box.
  810.  
  811. `(merge          {window|camera} CAM-ID  { WINDOW or CAMERA ... } )'
  812.      Modify the given window or camera, changing just those properties
  813.      specified in the last argument.  E.g.
  814.          (merge camera `Camera' { far 20 })
  815.      sets Camera's far clipping plane to 20 while leaving
  816.      other attributes untouched.
  817.  
  818. `(merge-ap       GEOM-ID APPEARANCE)'
  819.      Merge in some appearance characteristics to GEOM-ID.
  820.      Appearance parameters include surface and line color, shading
  821.      style, line width, and lighting.
  822.  
  823. `merge-base-ap is a synonym for merge-baseap.'
  824.  
  825. `(merge-baseap   APPEARANCE)'
  826.      Merge in some appearance characteristics to the base default
  827.      appearance (applied to every geom before its own apperance).
  828.      Lighting is typically included in the base appearance.
  829.  
  830. `(morehelp    command)'
  831.      `command' may include `*' wildcards.
  832.      Prints more info than `(help command)'.
  833.  
  834. `(name-object    ID NAME)'
  835.      Assign a new NAME (a string) to ID.  A number is appended if
  836.      that name is in use (for example, `foo' -> `foo<2>').  The new
  837.      name, possibly with number appended, may be used as object's
  838.      id thereafter.
  839.  
  840. `(ND-axes CAMID [CLUSTERNAME [Xindex Yindex Zindex]])'
  841.      In our model for N-D viewing (enabled by (dimension)), objects in
  842.      N-space are viewed by N-dimensional *camera clusters*.
  843.      Each real camera window belongs to some cluster, and shows &
  844.      manipulates a 3-D axis-aligned projected subspace of the N-space seen
  845.      by its cluster.  Moving one camera in a cluster affects its siblings.
  846.  
  847.      The ND-axes command configures all this.  It specifies a camera's
  848.      cluster membership, and the set of N-space axes which become the
  849.      3-D camera's X, Y, and Z axes.  Axes are specified by their indices,
  850.      from 0 to N-1 for an N-dimensional space.  Cluster CLUSTERNAME is
  851.      implicitly created if not previously known.
  852.      To read a camera's configuration, use `(echo (ND-axes CAMID))'.
  853.  
  854.  
  855. `(ND-color CAMID'
  856.          [ (( [ID] (x0 x1 x2 ... xn) v r g b a   v r g b a  ... )
  857.             ((x0 ... xn)  v r g b a  v r g b a ...) ...)] )
  858.      Specifies a function, applied to each N-D vertex, which determines the
  859.      colors of N-dimensional objects as shown in camera CAMID.
  860.      Each coloring function is defined by a vector (in ID's coordinate system)
  861.      [x0 x1 ... xn] and by a sequence of value (v)/color(r g b a) tuples,
  862.      ordered by increasing v.  The inner product v = P.[x] is linearly
  863.      interpolated in this table to give a color.
  864.      If ID is omitted, the (xi) vector is assumed in universe coordinates.
  865.      The ND-color command specifies a list of such functions; each vertex
  866.      is colored by their sum (so e.g. green intensity could indicate
  867.      projection along one axis while red indicated another.
  868.      An empty list, as in (ND-color CAMID ()), suppresses coloring.
  869.      With no second argument, (ND-color CAMID) returns that camera's
  870.      color-function list.
  871.      Even when coloring is enabled, objects tagged with the `keepcolor'
  872.      appearance attribute are shown in their natural colors.
  873.  
  874.  
  875. `(ND-xform OBJID [ntransform { idim odim  ... }])'
  876.      Sets or returns the N-D transform of the given object.
  877.      In dimension N, this is an (N+1)x(N+1) matrix.
  878.      Note that all cameras in a camera-cluster have the same N-D transform.
  879.  
  880.  
  881. `(ND-xform-get ID [from-ID])'
  882.      Returns the N-D transform of the given object in the coordinate system
  883.      of from-ID (default `universe'), in the sense
  884.        <point-in-ID-coords> * Transform = <point-in-from-ID-coords>
  885.  
  886.  
  887. `(new-alien      name [GEOMETRY])'
  888.      Create a new alien (geom not in the world) with the given name
  889.      (a string).  GEOMETRY is a string giving an OOGL geometry
  890.      specification.  If GEOMETRY is omitted, the new alien
  891.      is given an empty geometry.  If an object with that name
  892.      already exists, the new alien is given a unique name.  The
  893.      light beams that are used to move around the lights are an
  894.      example of aliens. They're drawn but are not controllable the
  895.      way ordinary objects are: they don't appear in the object
  896.      browser and the user can't move them with the normal motion
  897.      modes.
  898.  
  899. `(new-camera     name [CAMERA])'
  900.      Create a new camera with the given name (a string).  If a
  901.      camera with that name already exists, the new object is given
  902.      a unique name.  If CAMERA is omitted a default camera is used.
  903.  
  904. `(new-center [id])'
  905.      Stop id, then set id's transform to the identity.  Default id 
  906.      is target.  Also, if the id is a camera, calls 
  907.      (look-recenter World id).  The main function of the call to 
  908.      (look-recenter) is to place the camera so that it is pointing 
  909.      parallel to the z axis toward the center of the world.
  910.  
  911. `(new-geometry   name [GEOMETRY])'
  912.      Create a new geom with the given name (a string).  GEOMETRY is
  913.      a string giving an OOGL geometry specification.  If
  914.      GEOMETRY is omitted, the new object is given an empty geometry.
  915.      If an object with that name already exists, the new object is
  916.      given a unique name.
  917.  
  918. `(new-reset)'
  919.      Equivalent to (progn (new-center ALLGEOMS)(new-center ALLCAMS))
  920.  
  921. `(NeXT)'
  922.      Returns t if running on a NeXT, nil if not
  923.  
  924. `(normalization  GEOM-ID {each|none|all|keep})'
  925.      Set the normalization status of GEOM-ID.
  926.      `none'
  927.           suppresses all normalization.
  928.      `each'
  929.           normalizes the object's bounding box to fit into the unit
  930.           sphere, with the center of its bounding box translated
  931.           to the origin.  The box is scaled such that its long diagonal,
  932.           sqrt((xmax-xmin)^2 + (ymax-ymin)^2 + (zmax-zmin)^2), is 2.
  933.      `all'
  934.           resembles `each', except when an object is changing
  935.           (e.g. when its geometry is being changed by an external program).
  936.           Then, `each' tightly fits the bounding box around the
  937.           object whenever it changes and normalizes accordingly,
  938.           while `all' normalizes the union of all variants of the object
  939.           and normalizes accordingly.
  940.      `keep'
  941.           leaves the current normalization transform unchanged
  942.           when the object changes.  It may be useful to apply `each' or
  943.           `all' normalization apply to the first version of a changing
  944.           object to bring it in view, then switch to `keep'.
  945.  
  946. `(pick COORDSYS GEOMID G V E F P VI EI FI)'
  947.      The pick command is executed internally in response to pick
  948.      events (right mouse double click).
  949.  
  950.      COORDSYS = coordinate system in which coordinates of the following
  951.          arguments are specified.   This can be:
  952.          world: world coord sys
  953.          self:  coord sys of the picked geom (GEOMID)
  954.          primitive: coord sys of the actual primitive within
  955.              the picked geom where the pick occurred.
  956.      GEOMID = id of picked geom
  957.      G = picked point (actual intersection of pick ray with object)
  958.      V = picked vertex, if any
  959.      E = picked edge, if any
  960.      F = picked face
  961.      P = path to picked primitive [0 or more]
  962.      VI = index of picked vertex in primitive
  963.      EI = list of indices of endpoints of picked edge, if any
  964.      FI = index of picked face
  965.  
  966.      External modules can find out about pick events by registering
  967.      interest in calls to `pick' via the `interest' command.
  968.  
  969. `(pick-invisible [yes|no])'
  970.      Selects whether picks should be sensitive to objects whose appearance
  971.      makes them invisible; default yes.
  972.      With no arguments, returns current status.
  973.  
  974. `(pickable       GEOM-ID {yes|no})'
  975.      Say whether or not GEOM-ID is included in the pool of objects
  976.      that could be returned from the pick command.
  977.  
  978. `(position       objectID otherID)'
  979.      Set the transform of objectID to that of otherID.
  980.  
  981. `(position-at    objectID otherID [center | origin])'
  982.      Translate objectID to the center of the bounding box or the 
  983.      origin of the coordinate system of otherID (parallel translation).
  984.      Default is center.
  985.  
  986. `(position-toward objectID otherID [center | origin])'
  987.      Rotate objectID so that the center of the bounding box
  988.      or the origin of the coordinate system of the otherID
  989.      lies on the positive z-axis of the first object.  Default is
  990.      the center of the bounding box.
  991.  
  992. `(progn STATEMENT [ ... ])'
  993.      evaluates each STATEMENT in order and returns the value of the
  994.      last one.  Use progn to group a collection of commands together,
  995.      forcing them to be treated as a single command.
  996.  
  997. `quit is a synonym for `exit''
  998.  
  999. `(quote EXPR)'
  1000.      returns the symbolic lisp expression EXPR without evaluating it.
  1001.  
  1002. `(rawevent       dev val x y t)'
  1003.      Enter the specified raw event into the event queue.  The
  1004.      arguments directly specify the members of the event structure
  1005.      used internally by geomview.  This is the lowest level event
  1006.      handler and is not intended for general use.
  1007.  
  1008. `(rawpick CAMID X Y)'
  1009.      Process a pick event in camera CAMID at location (X,Y) given in
  1010.      integer pixel coordinates.  This is a low-level procedure not
  1011.      intended for external use.
  1012.  
  1013. `(read {geometry|camera|transform|command} {GEOMETRY or CAMERA or ...})'
  1014.      Read and interpret the text in ... as containing the
  1015.      given type of data.  Useful for defining objects using OOGL
  1016.      reference syntax, e.g.
  1017.  
  1018.        (geometry  thing { INST  transform : T    geom : fred })
  1019.        (read  geometry  { define fred QUAD 1 0 0  0 1 0  0 0 1  1 0 0 })
  1020.        (read  transform { define T <myfile})
  1021.  
  1022. `(real-id ID)'
  1023.      Returns a string canonically identifying the given ID,
  1024.      or `nil' if the object does not exist.  Examples:
  1025.       (if (real-id fred) (delete fred))
  1026.      deletes `fred' if it exists but reports no error if it doesn't, and
  1027.       (if (= (real-id targetgeom) (real-id World)) () (delete targetgeom))
  1028.      deletes `targetgeom' if it is different from the World.
  1029.  
  1030.  
  1031. `(redraw         CAM-ID)'
  1032.      States that the view in CAM-ID should be redrawn on the
  1033.      next pass through the main loop or the next invocation of `draw'.
  1034.  
  1035. `(regtable) --- shows the registry table'
  1036.  
  1037. `(rehash-emodule-path)'
  1038.      Rebuilds the application (external module) browser by reading
  1039.      all .geomview-* files in all directories on the emodule-path.
  1040.      Primarily intended for internal use; any applications defined
  1041.      by (emodule-define ...) commands outside of the .geomview-*
  1042.      files on the emodule-path will be lost.  Does not sort the
  1043.      entries in the brower; see (emodule-sort) for that.
  1044.  
  1045. `(replace-geometry GEOM-ID PART-SPECIFICATION GEOMETRY)'
  1046.      Replace a part of the geometry for GEOM-ID.
  1047.  
  1048. `(rib-display    [frame|tiff] FILEPREFIX)'
  1049.      Set Renderman display to framebuffer (popup screen window) or a
  1050.      TIFF format disk file. FILEPREFIX is used to construct
  1051.      names of the form `prefixNNNN.suffix'. (i.e. foo0000.rib)
  1052.      The number is incremented on every call to `rib-snapshot' and
  1053.      reset to 0000 when `rib-display' is called. TIFF files are given
  1054.      the same prefix and number as the RIB file (i.e. foo0004.rib
  1055.      generates foo0004.tiff). The default FILEPREFIX is `geom' and
  1056.      the default format is TIFF. (Note that geomview just generates a
  1057.      RIB file, which must then be rendered.)
  1058.  
  1059. `(rib-snapshot   CAM-ID  [filename])'
  1060.      Write Renderman snapshot (in RIB format) of CAM-ID to <filename>.
  1061.      If no filename specified, see `rib-display' for explanation of
  1062.      the filename used.
  1063.  
  1064. `(scale          GEOM-ID FACTOR [FACTORY FACTORZ])'
  1065.      Scale GEOM-ID, multiplying its size by FACTOR.  The factors 
  1066.      should be positive numbers.  If FACTORY and FACTORZ are 
  1067.      present and non-zero, the object is scaled by FACTOR in x, by 
  1068.      FACTORY in y, and by FACTORZ in z.  If only FACTOR is present, 
  1069.      the object is scaled by FACTOR in x, y, and z.  Scaling only 
  1070.      really makes sense in Euclidean space.  Mouse-driven scaling in 
  1071.      other spaces is not allowed;  the scale command may be issued 
  1072.      in other spaces but should be used with caution because it may 
  1073.      cause the data to extend beyond the limits of the space.
  1074.  
  1075. `(scene          CAM-ID [GEOMETRY])'
  1076.      Make CAM-ID look at GEOMETRY instead of at the universe.
  1077.  
  1078. `(set-clock TIME)'
  1079.      Adjusts the clock for this command stream to read TIME (in seconds)
  1080.      as of the moment the command is received.  See also sleep-until, clock.
  1081.  
  1082. `(set-conformal-refine CMX [N [SHOWEDGES]])'
  1083.      Sets the parameters for the refinement algorithm used in drawing
  1084.      in the conformal model.  CMX is the cosine of the maximum angle
  1085.      an edge can bend before it is refined.  Its value should be between
  1086.      -1 and 1; the default is 0.95; decreasing its value will cause less
  1087.      refinement.  N is the maximum number of iterations of refining;
  1088.      the default is 6.  SHOWEDGES, which should be `no' or `yes',
  1089.      determines whether interior edges in the refinement are drawn.
  1090.  
  1091. `(set-emodule-path      (PATH1 ... PATHN))'
  1092.      Sets the search path for external modules.  The PATHi should
  1093.      be pathnames of directories containing, for each module, the
  1094.      module's executable file and a .geomview-<modulename> file
  1095.      which contains an (emodule-define ...) command for that
  1096.      module.  This command implicitly calls (rehash-emodule-path)
  1097.      to rebuild the application brower from the new path setting.
  1098.      The special directory name `+' is replaced by the existing path,
  1099.      so e.g. (set-emodule-path (mydir +)) prepends mydir to the path.
  1100.  
  1101. `(set-load-path      (PATH1 ... PATHN))'
  1102.      Sets search path for command, geometry, etc. files.  The PATHi
  1103.      are strings giving the pathnames of directories to be searched.
  1104.      The special directory name `+' is replaced by the existing path,
  1105.      so e.g. (set-load-path (mydir +)) prepends mydir to the path.
  1106.  
  1107. `(set-motionscale X)'
  1108.      Set the motion scale factor to X (default value 0.5).  These
  1109.      commands scale their motion by an amount which depends on the
  1110.      distance from the frame to the center and on the size of the
  1111.      frame.  Specifically, they scale by
  1112.              dist + scaleof(frame) * motionscale
  1113.      where dist is the distance from the center to the frame and
  1114.      motionscale is the motion scale factor set by this function.
  1115.      Scaleof(frame) measures the size of the frame object.
  1116.  
  1117. `(setenv  name string)  sets the environment variable `name' to the value'
  1118.  
  1119.      STRING;
  1120.      the name is visible to geomview (as in pathnames containing `$name')
  1121.      and to processes it creates, e.g. external modules.
  1122.  
  1123. `(sgi)'
  1124.      Returns t if running on an sgi machine, nil if not
  1125.  
  1126. `(shell         SHELL-COMMAND)'
  1127.      Execute the given UNIX SHELL-COMMAND using /bin/sh.  Geomview
  1128.      waits for it to complete and will be unresponsive until it does.
  1129.      A synonym is `!'.
  1130.  
  1131. `(sleep-for  TIME)'
  1132.      Suspend reading commands from this stream for TIME seconds.
  1133.      Commands already read will still be executed; `sleep-for' inside
  1134.      `progn' won't delay execution of the rest of the progn's contents.
  1135.  
  1136. `(sleep-until TIME)'
  1137.      Suspend reading commands from this stream until TIME (in seconds).
  1138.      Commands already read will still be executed; `sleep-until' inside
  1139.      `progn' won't delay execution of the rest of the progn's contents.
  1140.      Time is measured according to this stream's clock, as set by
  1141.      `set-clock'; if never set, the first sleep-until sets it to 0
  1142.      (so initially (sleep-until TIME) is the same as (sleep-for TIME)).
  1143.      Returns the number of seconds until TIME.
  1144.  
  1145. `(snapshot       CAM-ID     FILENAME [FORMAT [XSIZE [YSIZE]]])'
  1146.      Save a snapshot of CAM-ID in the FILENAME (a string).  The
  1147.      FORMAT argument is optional; it may be `ppmscreen',
  1148.      `sgi', `ps', or `ppm'.  A `ppmscreen' snapshot is created by reading
  1149.      the image directly from the given window; the window is popped above
  1150.      other windows and redrawn first, then its contents are written as a
  1151.      PPM format image.  With `ps', dumps a Postscript picture representing
  1152.      the view from that window; hidden-surface removal might be incorrect.
  1153.      With `ppm', dumps a PPM-format image produced by geomview's internal
  1154.      software renderer; this may be of arbitrary size.  If the FILENAME
  1155.      argument begins with the vertical bar `|', it's interpreted as a
  1156.      /bin/sh command to which the PPM or PS data should be piped.
  1157.      Optional XSIZE and YSIZE values are relevant only for `ppm' format,
  1158.      and render to a window of that size (or scaled to that size,
  1159.      with aspect fixed, if only XSIZE is given)
  1160.  
  1161. `(soft-shader  CAM-ID  {on|off|toggle})'
  1162.      Select whether to use software or hardware shading in that camera.
  1163.  
  1164. `(space {euclidean|hyperbolic|spherical})'
  1165.      Set the space associated with the world.
  1166.  
  1167. `(stereowin CAM-ID  [no|horizontal|vertical|colored] [gapsize])'
  1168.      Configure CAM-ID as a stereo window.
  1169.      no: entire window is a single pane, stereo disabled
  1170.      horizontal: split left/right: left is stereo eye#0, right is #1.
  1171.      vertical: split top/bottom: bottom is eye#0, top is #1.
  1172.      colored: panes overlap, red is stereo eye#0, cyan is #1.
  1173.  
  1174.      A gap of `gapsize' pixels is left between subwindows;
  1175.      if omitted, subwindows are adjacent.
  1176.      If both layout and gapsize are omitted, e.g. (stereowin CAM-ID),
  1177.      returns current settings as a `(stereowin ...)' command list.
  1178.      This command doesn't set stereo projection; use `merge camera' or
  1179.      `camera' to set the stereyes transforms, and `merge window' or
  1180.      `window' to set the pixel aspect ratio & window position if needed.
  1181.  
  1182. `(time-interests deltatime initial prefix [suffix])'
  1183.      Indicates that all interest-related messages, when separated by at
  1184.      least `deltatime' seconds of real time, should be preceded by
  1185.      the string `prefix' and followed by `suffix'; the first message
  1186.      is preceded by `initial'.  All three are printf format strings,
  1187.      whose argument is the current clock time (in seconds) on that stream.
  1188.      A `deltatime' of zero timestamps every message.  Typical usage:
  1189.      (time-interests .1 `(set-clock %g)' `(sleep-until %g)')  or
  1190.      (time-interests .1 `(set-clock %g)'
  1191.          "(sleep-until %g) (progn (set-clock %g)" ")")    or
  1192.      (time-interests .1 "(set-clock %g)"
  1193.                 "(if (> 0 (sleep-until %g)) (" "))".
  1194.  
  1195. `(transform      objectID centerID frameID [rotate|translate|translate-scaled|scale] x y z [dt] [`smooth'])'
  1196.      Apply a motion (rotation, translation, scaling) to object `objectID';
  1197.      that is, construct and concatenate a transformation matrix with
  1198.      objectID's transform  The 3 IDs involved are the object
  1199.      that moves, the center of motion, and the frame of reference
  1200.      in which to apply the motion.  The center is easiest understood
  1201.      for rotations: if centerID is the same as objectID then it will
  1202.      spin around its own axes; otherwise the moving object will orbit
  1203.      the center object.  Normally frameID, in whose coordinate system
  1204.      the (mouse) motions are interpreted, is `focus', the current camera.
  1205.      Translations can be scaled proportional to the
  1206.      distance between the target and the center. Support for
  1207.      spherical and hyperbolic as well as Euclidean space is
  1208.      built-in: use the `space' command to change spaces.  With type
  1209.      `rotate' x, y, and z are floats specifying angles in RADIANS.
  1210.      For types `translate' and `translate-scaled' x, y, and z are
  1211.      floats specifying distances in the coordinate system of the
  1212.      center object.  The optional `dt' field allows a simple form of
  1213.      animation; if present, the object moves by just that amount during
  1214.      approximately `dt' seconds, then stops.  If present and followed by
  1215.      the `smooth' keyword, the motion is animated with a 3t^2-2t^3
  1216.      function, so as to start and stop smoothly.  If absent, the motion is
  1217.      applied immediately.
  1218.  
  1219. `(transform-incr  objectID centerID frameID [rotate|translate|translate-scaled|scale] x y z [dt])'
  1220.      Apply continuing motion: construct a transformation matrix and
  1221.      concatenate it with the current transform of objectID every
  1222.      refresh (sets objectID's incremental transform). Same syntax
  1223.      as transform.  If optional `dt' argument is present,
  1224.      the object is moved at each time step such that its average motion
  1225.      equals one instance of the motion per `dt' seconds.  E.g.
  1226.        (transform-incr  World World World  rotate  6.28318 0 0  10.0)
  1227.      rotates the World about its X axis at 1 turn (2pi radians) per 10 seconds.
  1228.  
  1229.  
  1230. `(transform-set objectID centerID frameID [rotate|translate|translate-scaled|scale] x y z)'
  1231.      Set objectID's transform to the constructed transform.
  1232.      Same syntax as transform.
  1233.  
  1234. `(ui-center      ID)'
  1235.              Set the center for user interface (i.e. mouse) controlled
  1236.              motions to object ID.
  1237.  
  1238. `ui-emotion-program is an obsolete command.'
  1239.      Use its new eqivalent `emodule-define' instead.
  1240.  
  1241. `ui-emotion-run is an obsolete command.'
  1242.      Use its new eqivalent `emodule_start' instead.
  1243.  
  1244. `(ui-freeze [on|off])'
  1245.              Toggle updating user interface panels. Off by default.
  1246.  
  1247. `(ui-panel       PANELNAME  {on|off} [ WINDOW ] )'
  1248.              Do or don't display the given user-interface panel.
  1249.              Case is ignored in panel names.  Current PANELNAMEs are:
  1250.                      geomview        main panel
  1251.                      tools           motion controls
  1252.                      appearance      appearance controls
  1253.                      cameras         camera controls
  1254.                      lighting        lighting controls
  1255.                      obscure         obscure controls
  1256.                      materials       material properties controls
  1257.                      command         command entry box
  1258.                      credits         geomview credits
  1259.              By default, the `geomview' and `tools' panels appear when
  1260.              geomview starts.  If the optional Window is supplied, a
  1261.              `position' clause (e.g. (ui-panel obscure on { position xmin
  1262.              xmax ymin ymax }) sets the panel's default position.  (Only
  1263.              xmin and ymin values are actually used.)  A present but empty
  1264.              Window, e.g.  `(ui-panel obscure on {})' causes interactive
  1265.              positioning.
  1266.  
  1267. `(ui-target      ID [yes|no])'
  1268.              Set the target of user actions (the selected line of the
  1269.              target object browser) to ID.  The second argument specifies
  1270.              whether to make ID the current object regardless of its type.
  1271.              If `no', then ID becomes the current object of its type
  1272.              (geom or camera).  The default is `yes'.  This command may
  1273.              result in a change of motion modes based on target choice.
  1274.  
  1275. `(uninterest (COMMAND [args]))'
  1276.      Undoes the effect of an `interest' command.  (COMMAND [args]) must
  1277.      be identical to those used in the `interest' command.
  1278.  
  1279. `(update [timestep_in_seconds])'
  1280.      Apply each incremental motion once.  Uses timestep if it's present and
  1281.      nonzero; otherwise motions are proportional to elapsed real time.
  1282.  
  1283. `(update-draw    CAM-ID  [timestep_in_seconds])'
  1284.      Apply each incremental motion once and then draw CAM-ID.
  1285.      Applies `timestep' seconds' worth of motion, or uses elapsed real
  1286.      time if `timestep' is absent or zero.
  1287.  
  1288. `(window         CAM-ID  WINDOW)'
  1289.      Specify attributes for the window of CAM-ID, e.g. its size
  1290.      or initial position, in the OOGL Window syntax.
  1291.      The special CAM-ID `default' specifies
  1292.      properties of future windows (created by `camera' or
  1293.      `new-camera').
  1294.  
  1295. `(winenter       CAM-ID)'
  1296.      Tell geomview that the mouse cursor is in the window
  1297.      of CAM-ID.  This function is for development purposes
  1298.      and is not intended for general use.
  1299.  
  1300. `(write {command,geometry,camera,transform,window} FILENAME [ID|(ID ...)] [self|world|universe|otherID])'
  1301.      write description of ID in given format to FILENAME.  Last
  1302.      parameter chooses coordinate system for geometry & transform:
  1303.      self: just the object, no transformation or appearance (geometry only)
  1304.      world: the object as positioned within the World.
  1305.      universe: object's position in universal coordinates;
  1306.      includes Worldtransform
  1307.      other ID: the object transformed to otherID's coordinate system.
  1308.  
  1309.      A filename of `-' is a special case: data are written to the
  1310.      stream from which the 'write' command was read.  For external
  1311.      modules, the data are sent to the module's standard input.
  1312.      For commands not read from an external program, `-' means
  1313.      geomview's standard output.  (See also the `command'
  1314.      command.)
  1315.  
  1316.      The ID can either be a single id or a parenthesized list of
  1317.      ids, like `g0' or `(g2 g1 dodec.off)'.
  1318.  
  1319. `(write-comments FILENAME GEOMID PICKPATH)'
  1320.      write OOGL COMMENT objects in the GEOMID hierarchy at the
  1321.           level of the pick path to FILENAME. Specifically, COMMENTS
  1322.           at level (a b c ... f g) will match pick paths of the form
  1323.           (a b c ... f *) where * includes any value of g, and also
  1324.           any values of possible further indices h,i,j, etc. The pick
  1325.           path (returned in the `pick' command) is a list of
  1326.           integer counters specifying a subpart of a hierarchical
  1327.           OOGL object. Descent into a complex object (LIST or INST)
  1328.           adds a new integer to the path. Traversal of simple objects
  1329.           increments the counter at the current level.
  1330.           Individual COMMENTS are enclosed by curly braces, and the
  1331.           entire string of zero, one, or more COMMENTS (written in
  1332.           the order in which they are encountered during hierarchy
  1333.           traversal) is enclosed by parentheses.
  1334.         
  1335.              Note that arbitrary data can only be passed through the OOGL
  1336.           libraries as full-fledged OOGL COMMENT objects, which can be
  1337.           attached to other OOGL objects via the LIST type as described
  1338.           above. Ordinary comments in OOGL files (i.e. everything after
  1339.           '#' on a line) are ignored at when the file is loaded and
  1340.           cannot be returned.
  1341.  
  1342. `(write-sexpr     FILENAME LISPOBJECT)'
  1343.      Writes the given LISPOBJECT to FILENAME. This function is intended
  1344.      for internal debugging use only.
  1345.  
  1346. `(xform          ID TRANSFORM)'
  1347.      Concatenate TRANSFORM with the current transform of the object
  1348.      (apply TRANSFORM to object ID).
  1349.  
  1350. `(xform-incr     ID TRANSFORM)'
  1351.      Apply continual motion: concatenate TRANSFORM with the current
  1352.      transform of the object every refresh (set object ID's
  1353.      incremental transform to TRANSFORM).
  1354.  
  1355. `(xform-set      ID TRANSFORM)'
  1356.      Overwrite the current object transform with TRANSFORM (set
  1357.      object ID's transform to TRANSFORM).
  1358.  
  1359. `(zoom           CAM-ID FACTOR)'
  1360.      Zoom CAM-ID, multiplying its field of view by FACTOR.
  1361.      FACTOR should be a positive number.
  1362.  
  1363.  
  1364.  
  1365. 
  1366.